Skip to content

Conversation

@j-t-1
Copy link
Contributor

@j-t-1 j-t-1 commented Mar 21, 2025

RET503: Missing explicit "return" at the end of function able to return non-"None" value.

j-t-1 added 4 commits March 21, 2025 12:18
RET503: Missing explicit "return" at the end of function able to return non-"None" value.
RET503: Missing explicit "return" at the end of function able to return non-"None" value.
RET503: Missing explicit "return" at the end of function able to return non-"None" value.
RET503: Missing explicit "return" at the end of function able to return non-"None" value.
@codecov
Copy link

codecov bot commented Mar 21, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.11%. Comparing base (e3ab6c1) to head (c3d9dbe).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3209      +/-   ##
==========================================
+ Coverage   97.10%   97.11%   +0.01%     
==========================================
  Files          57       57              
  Lines        9711     9713       +2     
  Branches     1759     1758       -1     
==========================================
+ Hits         9430     9433       +3     
  Misses        168      168              
+ Partials      113      112       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

j-t-1 added 5 commits March 22, 2025 15:11
RET503: Missing explicit "return" at the end of function able to return non-"None" value.
RET503: Missing explicit "return" at the end of function able to return non-"None" value.
RET503: Missing explicit "return" at the end of function able to return non-"None" value.
RET503: Missing explicit "return" at the end of function able to return non-"None" value.
RET503: Missing explicit "return" at the end of function able to return non-"None" value.
@stefan6419846 stefan6419846 added the needs-test A test should be added before this PR is merged. label Mar 24, 2025
@j-t-1
Copy link
Contributor Author

j-t-1 commented Jul 18, 2025

@stefan6419846 could you fix the two Ruff errors (2 fixable with the --fix option)? I do not have Ruff installed.

@stefan6419846
Copy link
Collaborator

could you fix the two Ruff errors

Just use return None instead of return in these cases if it is a correct detection (as indicated in the help for the violation). If the detection is wrong, we would have to check manually anyway.

@j-t-1
Copy link
Contributor Author

j-t-1 commented Oct 29, 2025

@stefan6419846 the return None is needed so we can remove RET503. Can you think of a way to reach this line, as otherwise code coverage is reduced.

@stefan6419846
Copy link
Collaborator

I guess root = DictionaryObject({NameObject('/Next'): None}) could work, but AFAIK this branch should not be reachable with real PDF files as None is no PDF object. See #3209 (comment) as well.

@j-t-1
Copy link
Contributor Author

j-t-1 commented Oct 29, 2025

I have marked it as pragma: no cover, as agree with you, I think is unreachable with real PDFs. Outlines are conceptually not difficult, and maybe a refactor of them may be useful.

@stefan6419846 stefan6419846 removed the needs-test A test should be added before this PR is merged. label Nov 5, 2025
@stefan6419846 stefan6419846 merged commit 1967d25 into py-pdf:main Nov 6, 2025
16 checks passed
@j-t-1 j-t-1 deleted the RET503 branch November 6, 2025 17:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants